/*
 * @(#)DownloaderListener.java	0.1 12/28/04
 *
 * Copyright 2004 Fabio Gasparetti. All rights reserved.
 */

package org.tabularium.net.downloader;

import java.util.EventListener;

/**
 * A Listener interface for the downloader events. See {@link Downloader} class
 * comments for further details.
 * 
 * @author Fabio Gasparetti
 * @version 0.1, 12/28/04
 */
public interface DownloaderListener extends EventListener {

	/**
	 * 
	 * @param ev
	 */
	public void downloadCompleted(DownloadEvent ev);

	/**
	 * An empty resource is returned if a connection error occurs or if the
	 * remote server returns an error status code. The method is also called
	 * when the redirection policy has not allowed a redirect connection. The
	 * method downloadCompleted will be not invoked.
	 * 
	 * Note: events' exception can be null.
	 */
	public void error(DownloadEvent ev);

	/**
	 * 
	 * @param ev
	 */
	public void queueEmpty(DownloadEvent ev);

}
